﻿@using SCMS.Resources
@model SCMS.UI.Models.WRForm
@{AjaxOptions ajaxOpts = new AjaxOptions
      {

          UpdateTargetId = "wrfDiv",
          LoadingElementId = "loading",
          HttpMethod = "Post",
          Url = Url.Action("SaveWRN/" + ViewBag.WRNId),
          OnBegin = "return CheckAvailableQty()",
          OnSuccess = "hidebutton('btnsave');CloseDialog();",
          OnFailure = "javascript:errormsg()"

      };}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/js/procument.js")" type="text/javascript"></script>
@using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form" }))
{
    @Html.ValidationSummary(true)
    <input type="hidden" id="wrnId" value="@ViewBag.WRNId" />
    <input type="hidden" id="actionStatus" value="@ViewBag.Response" />
    <input type="hidden" id="statusMsg" value="@ViewBag.msg" />
    <fieldset>
        <table>
            <tr>
                <td>
                    @Resources_morgan.Global_String_ItemName
                </td>
                <td align="left" class="editor-field">
                    @Html.DropDownListFor(model => model.EntityWhouseRItem.InventoryId, Model.Items, Resources_frank.Global_String_PleaseSelect, new { @id = "inventoryId", onchange = "javascript:InvtselectedIndexChange(this)" })
                    @Html.ValidationMessageFor(model => model.EntityWhouseRItem.InventoryId)
                </td>
            </tr>
            <tr>
                <td>
                    @Resources_morgan.WRForm_LoadWRFItem_QuantityAsset
                </td>
                <td class="editor-field">
                    <div id="PBlines">
                        @Html.TextBoxFor(model => model.EntityWhouseRItem.Quantity, new { @id = "txtqtyordered" })
                        @Html.ValidationMessageFor(model => model.EntityWhouseRItem.Quantity)
                        @* @Html.DropDownListFor(model => model.EntityWhouseRItem.AssetId, Model.Items, "- please select -",new { @id = "dplassetId" })
                        @Html.ValidationMessageFor(model => model.EntityWhouseRItem.AssetId)
                        <input type="hidden" id="txtqtyordered" value="0" />*@
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    @Resources_morgan.Global_String_Comments
                </td>
                <td align="left" class="editor-field">@Html.TextAreaFor(model => model.EntityWhouseRItem.Comments)
                    @Html.ValidationMessageFor(model => model.EntityWhouseRItem.Comments)
                </td>
            </tr>
        </table>
        <br />
        <p>
            &nbsp;&nbsp;
            <input type="submit" class="btn green" value=" @Resources_frank.Global_String_AddItem " />&nbsp;&nbsp;&nbsp;
            <!--<input type="button" class="btn green" value=" @Resources_frank.Global_String_Finish " onclick="sendRequest('LoadWRItems/@ViewBag.WRNId', 'wrfDiv', 'loading');javascript:CloseDialog();hidebutton('btnsave');" />-->
        </p>
    </fieldset>
}
